Action hook 'saved_{$taxonomy}'

in WP Core File wp-includes/taxonomy.php at line 3489

View Source

saved_{$taxonomy}

Action Hook
Description
Fires after a term for a specific taxonomy has been updated, and the term cache has been cleaned. The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. Possible hook names include: - `edited_category` - `edited_post_tag`

Hook Information

File Location wp-includes/taxonomy.php View on GitHub
Hook Type Action
Line Number 3489

Hook Parameters

Type Name Description
int $term_id Term ID.
int $tt_id Term taxonomy ID.
array $args Arguments passed to wp_update_term().

Usage Examples

Basic Usage
<?php
// Hook into saved_{$taxonomy}
add_action('saved_{$taxonomy}', 'my_custom_function', 10, 3);

function my_custom_function($term_id, $tt_id, $args) {
    // Your custom code here
}

Source Code Context

wp-includes/taxonomy.php:3489 - How this hook is used in WordPress core
<?php
3484  
3485  	/** This action is documented in wp-includes/taxonomy.php */
3486  	do_action( 'saved_term', $term_id, $tt_id, $taxonomy, true, $args );
3487  
3488  	/** This action is documented in wp-includes/taxonomy.php */
3489  	do_action( "saved_{$taxonomy}", $term_id, $tt_id, true, $args );
3490  
3491  	return array(
3492  		'term_id'          => $term_id,
3493  		'term_taxonomy_id' => $tt_id,
3494  	);

PHP Documentation

<?php
/**
	 * Fires after a term for a specific taxonomy has been updated, and the term
	 * cache has been cleaned.
	 *
	 * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
	 *
	 * Possible hook names include:
	 *
	 *  - `edited_category`
	 *  - `edited_post_tag`
	 *
	 * @since 2.3.0
	 * @since 6.1.0 The `$args` parameter was added.
	 *
	 * @param int   $term_id Term ID.
	 * @param int   $tt_id   Term taxonomy ID.
	 * @param array $args    Arguments passed to wp_update_term().
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-includes/taxonomy.php
Related Hooks

Related hooks will be displayed here in future updates.